function e(e){return e.replace(/^(https?:\/\/(www\.)?|mailto:)/gi,``).replace(/\/$/,``)}function t(e,t){let n=[];for(let[r,i]of Object.entries(e))if(i!=null){Array.isArray(i)||(i=[i]);for(let e of i)t&&!t(e)||e!=null&&n.push(`${encodeURIComponent(r)}=${encodeURIComponent(String(e))}`)}return n.join(`&`)}export{e as n,t};